home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / PInterfaces / QuickTimeMusic.p < prev    next >
Encoding:
Text File  |  1996-09-22  |  57.7 KB  |  1,400 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QuickTimeMusic.p
  3.  
  4.      Contains:    QuickTime Interfaces.
  5.  
  6.      Version:    Technology:    QuickTime 2.5
  7.                  Release:    Universal Interfaces 2.1.4
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT QuickTimeMusic;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __QUICKTIMEMUSIC__}
  28. {$SETC __QUICKTIMEMUSIC__ := 1}
  29.  
  30. {$I+}
  31. {$SETC QuickTimeMusicIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __COMPONENTS__}
  35. {$I Components.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __IMAGECOMPRESSION__}
  38. {$I ImageCompression.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __MOVIES__}
  41. {$I Movies.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __QUICKDRAW__}
  44. {$I Quickdraw.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __VIDEO__}
  47. {$I Video.p}
  48. {$ENDC}
  49. {$IFC UNDEFINED __MEMORY__}
  50. {$I Memory.p}
  51. {$ENDC}
  52. {$IFC UNDEFINED __SOUND__}
  53. {$I Sound.p}
  54. {$ENDC}
  55.  
  56. {$PUSH}
  57. {$ALIGN MAC68K}
  58. {$LibExport+}
  59.  
  60. CONST
  61.     kaiToneDescType                = 'tone';
  62.     kaiNoteRequestInfoType        = 'ntrq';
  63.     kaiKnobListType                = 'knbl';
  64.     kaiKeyRangeInfoType            = 'sinf';
  65.     kaiSampleDescType            = 'sdsc';
  66.     kaiSampleInfoType            = 'smin';
  67.     kaiSampleDataType            = 'sdat';
  68.     kaiInstInfoType                = 'iinf';
  69.     kaiPictType                    = 'pict';
  70.     kaiWriterType                = '©wrt';
  71.     kaiCopyrightType            = '©cpy';
  72.     kaiOtherStrType                = 'str ';
  73.     kaiInstrumentRefType        = 'iref';
  74.     kaiLibraryInfoType            = 'linf';
  75.     kaiLibraryDescType            = 'ldsc';
  76.  
  77.  
  78. TYPE
  79.     InstLibDescRecPtr = ^InstLibDescRec;
  80.     InstLibDescRec = RECORD
  81.         libIDName:                Str31;
  82.     END;
  83.  
  84.     InstKnobRecPtr = ^InstKnobRec;
  85.     InstKnobRec = RECORD
  86.         number:                    LONGINT;
  87.         value:                    LONGINT;
  88.     END;
  89.  
  90.  
  91. CONST
  92.     kInstKnobMissingUnknown        = 0;
  93.     kInstKnobMissingDefault        = $01;
  94.  
  95.  
  96. TYPE
  97.     InstKnobListPtr = ^InstKnobList;
  98.     InstKnobList = RECORD
  99.         knobCount:                LONGINT;
  100.         knobFlags:                LONGINT;
  101.         knob:                    ARRAY [0..0] OF InstKnobRec;
  102.     END;
  103.  
  104.  
  105. CONST
  106.     kMusicLoopTypeNormal        = 0;
  107.     kMusicLoopTypePalindrome    = 1;                            {  back & forth }
  108.  
  109.     instSamplePreProcessFlag    = $01;
  110.  
  111.  
  112. TYPE
  113.     InstSampleDescRecPtr = ^InstSampleDescRec;
  114.     InstSampleDescRec = RECORD
  115.         dataFormat:                OSType;
  116.         numChannels:            INTEGER;
  117.         sampleSize:                INTEGER;
  118.         sampleRate:                UnsignedFixed;
  119.         sampleDataID:            INTEGER;
  120.         offset:                    LONGINT;                                {  offset within SampleData - this could be just for internal use }
  121.         numSamples:                LONGINT;                                {  this could also just be for internal use, we'll see }
  122.         loopType:                LONGINT;
  123.         loopStart:                LONGINT;
  124.         loopEnd:                LONGINT;
  125.         pitchNormal:            LONGINT;
  126.         pitchLow:                LONGINT;
  127.         pitchHigh:                LONGINT;
  128.     END;
  129.  
  130.  
  131. TYPE
  132.     AtomicInstrument                    = Handle;
  133.     AtomicInstrumentPtr                    = Ptr;
  134.  
  135. CONST
  136.     kMusicComponentType            = 'musi';
  137.  
  138.     kSoftSynthComponentSubType    = 'ss  ';
  139.     kGMSynthComponentSubType    = 'gm  ';
  140.  
  141.  
  142. TYPE
  143.     MusicComponent                        = ComponentInstance;
  144. {  MusicSynthesizerFlags }
  145.  
  146. CONST
  147.     kSynthesizerDynamicVoice    = $01;                            {  can assign voices on the fly (else, polyphony is very important  }
  148.     kSynthesizerUsesMIDIPort    = $02;                            {  must be patched through MIDI Manager  }
  149.     kSynthesizerMicrotone        = $04;                            {  can play microtonal scales  }
  150.     kSynthesizerHasSamples        = $08;                            {  synthesizer has some use for sampled data  }
  151.     kSynthesizerMixedDrums        = $10;                            {  any part can play drum parts, total = instrument parts  }
  152.     kSynthesizerSoftware        = $20;                            {  implemented in main CPU software == uses cpu cycles  }
  153.     kSynthesizerHardware        = $40;                            {  is a hardware device (such as nubus, or maybe DSP?)  }
  154.     kSynthesizerDynamicChannel    = $80;                            {  can move any part to any channel or disable each part. (else we assume it lives on all channels in masks)  }
  155.     kSynthesizerHogsSystemChannel = $0100;                        {  can be channelwise dynamic, but always responds on its system channel  }
  156.     kSynthesizerSlowSetPart        = $0400;                        {  SetPart() and SetPartInstrumentNumber() calls do not have rapid response, may glitch notes  }
  157.     kSynthesizerOffline            = $1000;                        {  can enter an offline synthesis mode  }
  158.     kSynthesizerGM                = $4000;                        {  synth is a GM device  }
  159.     kSynthesizerSoundLocalization = $00010000;                    {  synth is a GM device  }
  160.  
  161. {
  162.  * Note that these controller numbers
  163.  * are _not_ identical to the MIDI controller numbers.
  164.  * These are _signed_ 8.8 values, and the LSB's are
  165.  * always sent to a MIDI device. Controllers 32-63 are
  166.  * reserved (for MIDI, they are LSB's for 0-31, but we
  167.  * always send both).
  168.  *
  169.  * The full range, therefore, is -128.00 to 127.7f.
  170.  *
  171.  * _Excepting_ _volume_, all controls default to zero.
  172.  *
  173.  * Pitch bend is specified in fractional semitones! No
  174.  * more "pitch bend range" nonsense. You can bend as far
  175.  * as you want, any time you want.
  176. }
  177.  
  178. TYPE
  179.     MusicController                        = SInt32;
  180.  
  181. CONST
  182.     kControllerModulationWheel    = 1;
  183.     kControllerBreath            = 2;
  184.     kControllerFoot                = 4;
  185.     kControllerPortamentoTime    = 5;                            {  portamento on/off is omitted, 0 time = 'off'  }
  186.     kControllerVolume            = 7;
  187.     kControllerBalance            = 8;
  188.     kControllerPan                = 10;                            {  0 - "default", 1 - n: positioned in output 1-n (incl fractions)  }
  189.     kControllerExpression        = 11;
  190.     kControllerLever1            = 16;                            {  general purpose controllers  }
  191.     kControllerLever2            = 17;                            {  general purpose controllers  }
  192.     kControllerLever3            = 18;                            {  general purpose controllers  }
  193.     kControllerLever4            = 19;                            {  general purpose controllers  }
  194.     kControllerLever5            = 80;                            {  general purpose controllers  }
  195.     kControllerLever6            = 81;                            {  general purpose controllers  }
  196.     kControllerLever7            = 82;                            {  general purpose controllers  }
  197.     kControllerLever8            = 83;                            {  general purpose controllers  }
  198.     kControllerPitchBend        = 32;                            {  positive & negative semitones, with 7 bits fraction  }
  199.     kControllerAfterTouch        = 33;                            {  aka channel pressure  }
  200.     kControllerSustain            = 64;                            {  boolean - positive for on, 0 or negative off  }
  201.     kControllerSostenuto        = 66;                            {  boolean  }
  202.     kControllerSoftPedal        = 67;                            {  boolean  }
  203.     kControllerReverb            = 91;
  204.     kControllerTremolo            = 92;
  205.     kControllerChorus            = 93;
  206.     kControllerCeleste            = 94;
  207.     kControllerPhaser            = 95;
  208.     kControllerEditPart            = 113;                            {  last 16 controllers 113-128 and above are global controllers which respond on part zero  }
  209.     kControllerMasterTune        = 114;
  210.  
  211.     kControllerMaximum            = $7FFF;                        {  +01111111.11111111  }
  212.     kControllerMinimum            = $8000;                        {  -10000000.00000000  }
  213.  
  214.  
  215. TYPE
  216.     SynthesizerDescriptionPtr = ^SynthesizerDescription;
  217.     SynthesizerDescription = RECORD
  218.         synthesizerType:        OSType;                                    {  synthesizer type (must be same as component subtype)  }
  219.         name:                    Str31;                                    {  text name of synthesizer type  }
  220.         flags:                    LONGINT;                                {  from the above enum  }
  221.         voiceCount:                LONGINT;                                {  maximum polyphony  }
  222.         partCount:                LONGINT;                                {  maximum multi-timbrality (and midi channels)  }
  223.         instrumentCount:        LONGINT;                                {  non gm, built in (rom) instruments only  }
  224.         modifiableInstrumentCount: LONGINT;                                {  plus n-more are user modifiable  }
  225.         channelMask:            LONGINT;                                {  (midi device only) which channels device always uses  }
  226.         drumPartCount:            LONGINT;                                {  maximum multi-timbrality of drum parts  }
  227.         drumCount:                LONGINT;                                {  non gm, built in (rom) drumkits only  }
  228.         modifiableDrumCount:    LONGINT;                                {  plus n-more are user modifiable  }
  229.         drumChannelMask:        LONGINT;                                {  (midi device only) which channels device always uses  }
  230.         outputCount:            LONGINT;                                {  number of audio outputs (usually two)  }
  231.         latency:                LONGINT;                                {  response time in µSec  }
  232.         controllers:            ARRAY [0..3] OF LONGINT;                {  array of 128 bits  }
  233.         gmInstruments:            ARRAY [0..3] OF LONGINT;                {  array of 128 bits  }
  234.         gmDrums:                ARRAY [0..3] OF LONGINT;                {  array of 128 bits  }
  235.     END;
  236.  
  237.  
  238. CONST
  239.     kVoiceCountDynamic            = -1;                            {  constant to use to specify dynamic voicing  }
  240.  
  241.  
  242. TYPE
  243.     ToneDescriptionPtr = ^ToneDescription;
  244.     ToneDescription = RECORD
  245.         synthesizerType:        OSType;                                    {  synthesizer type  }
  246.         synthesizerName:        Str31;                                    {  name of instantiation of synth  }
  247.         instrumentName:            Str31;                                    {  preferred name for human use  }
  248.         instrumentNumber:        LONGINT;                                {  inst-number used if synth-name matches  }
  249.         gmNumber:                LONGINT;                                {  Best matching general MIDI number  }
  250.     END;
  251.  
  252.  
  253. CONST
  254.     kFirstDrumkit                = 16384;                        {  (first value is "no drum". instrument numbers from 16384->16384+128 are drumkits, and for GM they are _defined_ drumkits!  }
  255.     kLastDrumkit                = 16512;
  256.  
  257. {  InstrumentMatch }
  258.     kInstrumentMatchSynthesizerType = 1;
  259.     kInstrumentMatchSynthesizerName = 2;
  260.     kInstrumentMatchName        = 4;
  261.     kInstrumentMatchNumber        = 8;
  262.     kInstrumentMatchGMNumber    = 16;
  263.  
  264. {  KnobFlags }
  265.     kKnobReadOnly                = 16;                            {  knob value cannot be changed by user or with a SetKnob call  }
  266.     kKnobInterruptUnsafe        = 32;                            {  only alter this knob from foreground task time (may access toolbox)  }
  267.     kKnobKeyrangeOverride        = 64;                            {  knob can be overridden within a single keyrange (software synth only)  }
  268.     kKnobGroupStart                = 128;                            {  knob is first in some logical group of knobs  }
  269.     kKnobFixedPoint8            = 1024;
  270.     kKnobFixedPoint16            = 2048;                            {  One of these may be used at a time.  }
  271.     kKnobTypeNumber                = $00;
  272.     kKnobTypeGroupName            = $1000;                        {  "knob" is really a group name for display purposes  }
  273.     kKnobTypeBoolean            = $2000;                        {  if range is greater than 1, its a multi-checkbox field  }
  274.     kKnobTypeNote                = $3000;                        {  knob range is equivalent to MIDI keys  }
  275.     kKnobTypePan                = $4000;                        {  range goes left/right (lose this? )  }
  276.     kKnobTypeInstrument            = $5000;                        {  knob value = reference to another instrument number  }
  277.     kKnobTypeSetting            = $6000;                        {  knob value is 1 of n different things (eg, fm algorithms) popup menu  }
  278.     kKnobTypeMilliseconds        = $7000;                        {  knob is a millisecond time range  }
  279.     kKnobTypePercentage            = $8000;                        {  knob range is displayed as a Percentage  }
  280.     kKnobTypeHertz                = $9000;                        {  knob represents frequency  }
  281.     kKnobTypeButton                = $A000;                        {  momentary trigger push button  }
  282.  
  283.     kUnknownKnobValue            = $7FFFFFFF;                    {  a knob with this value means, we don't know it.  }
  284.     kDefaultKnobValue            = $7FFFFFFE;                    {  used to SET a knob to its default value.  }
  285.  
  286.  
  287. TYPE
  288.     KnobDescriptionPtr = ^KnobDescription;
  289.     KnobDescription = RECORD
  290.         name:                    Str63;
  291.         lowValue:                LONGINT;
  292.         highValue:                LONGINT;
  293.         defaultValue:            LONGINT;                                {  a default instrument is made of all default values  }
  294.         flags:                    LONGINT;
  295.         knobID:                    LONGINT;
  296.     END;
  297.  
  298.     GCInstrumentDataPtr = ^GCInstrumentData;
  299.     GCInstrumentData = RECORD
  300.         tone:                    ToneDescription;
  301.         knobCount:                LONGINT;
  302.         knob:                    ARRAY [0..0] OF LONGINT;
  303.     END;
  304.  
  305.     GCInstrumentDataHandle                = ^GCInstrumentDataPtr;
  306.     InstrumentAboutInfoPtr = ^InstrumentAboutInfo;
  307.     InstrumentAboutInfo = RECORD
  308.         p:                        PicHandle;
  309.         author:                    Str255;
  310.         copyright:                Str255;
  311.         other:                    Str255;
  312.     END;
  313.  
  314.  
  315. CONST
  316.     kMusicPacketPortLost        = 1;                            {  received when application loses the default input port  }
  317.     kMusicPacketPortFound        = 2;                            {  received when application gets it back out from under someone else's claim  }
  318.     kMusicPacketTimeGap            = 3;                            {  data[0] = number of milliseconds to keep the MIDI line silent  }
  319.  
  320.  
  321. TYPE
  322.     MusicMIDIPacketPtr = ^MusicMIDIPacket;
  323.     MusicMIDIPacket = RECORD
  324.         length:                    INTEGER;
  325.         reserved:                LONGINT;                                {  if length zero, then reserved = above enum  }
  326.         data:                    PACKED ARRAY [0..248] OF UInt8;
  327.     END;
  328.  
  329.     MusicMIDISendProcPtr = ProcPtr;  { FUNCTION MusicMIDISend(self: MusicComponent; refCon: LONGINT; VAR mmp: MusicMIDIPacket): ComponentResult; }
  330.  
  331.     MusicMIDISendUPP = UniversalProcPtr;
  332.     MusicMIDIReadHookProcPtr = ProcPtr;  { FUNCTION MusicMIDIReadHook(VAR mp: MusicMIDIPacket; myRefCon: LONGINT): ComponentResult; }
  333.  
  334.     MusicMIDIReadHookUPP = UniversalProcPtr;
  335.  
  336. CONST
  337.     notImplementedMusicErr        = $8000F7E9;
  338.     cantSendToSynthesizerErr    = $8000F7E8;
  339.     cantReceiveFromSynthesizerErr = $8000F7E7;
  340.     illegalVoiceAllocationErr    = $8000F7E6;
  341.     illegalPartErr                = $8000F7E5;
  342.     illegalChannelErr            = $8000F7E4;
  343.     illegalKnobErr                = $8000F7E3;
  344.     illegalKnobValueErr            = $8000F7E2;
  345.     illegalInstrumentErr        = $8000F7E1;
  346.     illegalControllerErr        = $8000F7E0;
  347.     midiManagerAbsentErr        = $8000F7DF;
  348.     synthesizerNotRespondingErr    = $8000F7DE;
  349.     synthesizerErr                = $8000F7DD;
  350.     illegalNoteChannelErr        = $8000F7DC;
  351.     noteChannelNotAllocatedErr    = $8000F7DB;
  352.     tunePlayerFullErr            = $8000F7DA;
  353.     tuneParseErr                = $8000F7D9;
  354.  
  355.     kGetAtomicInstNoExpandedSamples = $01;
  356.     kGetAtomicInstNoOriginalSamples = $02;
  357.     kGetAtomicInstNoSamples        = $03;
  358.     kGetAtomicInstNoKnobList    = $04;
  359.     kGetAtomicInstNoInstrumentInfo = $08;
  360.     kGetAtomicInstOriginalKnobList = $10;
  361.     kGetAtomicInstAllKnobs        = $20;                            {  return even those that are set to default }
  362.  
  363. {
  364.  For non-gm instruments, instrument number of tone description == 0
  365.  If you want to speed up while running, slam the inst num with what Get instrument number returns
  366.  All missing knobs are slammed to the default value
  367. }
  368.     kSetAtomicInstKeepOriginalInstrument = $01;
  369.     kSetAtomicInstShareAcrossParts = $02;                        {  inst disappears when app goes away }
  370.     kSetAtomicInstCallerTosses    = $04;                            {  the caller isn't keeping a copy around (for NASetAtomicInstrument) }
  371.     kSetAtomicInstCallerGuarantees = $08;                        {  the caller guarantees a copy is around }
  372.     kSetAtomicInstInterruptSafe    = $10;                            {  dont move memory at this time (but process at next task time) }
  373.     kSetAtomicInstDontPreprocess = $80;                            {  perform no further preprocessing because either 1)you know the instrument is digitally clean, or 2) you got it from a GetPartAtomic }
  374.  
  375.     kInstrumentNamesModifiable    = 1;
  376.     kInstrumentNamesBoth        = 2;
  377.  
  378. {
  379.  * Structures specific to the GenericMusicComponent
  380. }
  381.     kGenericMusicComponentSubtype = 'gene';
  382.  
  383.  
  384. TYPE
  385.     GenericKnobDescriptionPtr = ^GenericKnobDescription;
  386.     GenericKnobDescription = RECORD
  387.         kd:                        KnobDescription;
  388.         hw1:                    LONGINT;                                {  driver defined  }
  389.         hw2:                    LONGINT;                                {  driver defined  }
  390.         hw3:                    LONGINT;                                {  driver defined  }
  391.         settingsID:                LONGINT;                                {  resource ID list for boolean and popup names  }
  392.     END;
  393.  
  394.     GenericKnobDescriptionListPtr = ^GenericKnobDescriptionList;
  395.     GenericKnobDescriptionList = RECORD
  396.         knobCount:                LONGINT;
  397.         knob:                    ARRAY [0..0] OF GenericKnobDescription;
  398.     END;
  399.  
  400.     GenericKnobDescriptionListHandle    = ^GenericKnobDescriptionListPtr;
  401. {  knobTypes for MusicDerivedSetKnob  }
  402.  
  403. CONST
  404.     kGenericMusicKnob            = 1;
  405.     kGenericMusicInstrumentKnob    = 2;
  406.     kGenericMusicDrumKnob        = 3;
  407.     kGenericMusicGlobalController = 4;
  408.  
  409.     kGenericMusicResFirst        = 0;
  410.     kGenericMusicResMiscStringList = 1;                            {  STR# 1: synth name, 2:about author,3:aboutcopyright,4:aboutother  }
  411.     kGenericMusicResMiscLongList = 2;                            {  Long various params, see list below  }
  412.     kGenericMusicResInstrumentList = 3;                            {  NmLs of names and shorts, categories prefixed by '••'  }
  413.     kGenericMusicResDrumList    = 4;                            {  NmLs of names and shorts  }
  414.     kGenericMusicResInstrumentKnobDescriptionList = 5;            {  Knob  }
  415.     kGenericMusicResDrumKnobDescriptionList = 6;                {  Knob  }
  416.     kGenericMusicResKnobDescriptionList = 7;                    {  Knob  }
  417.     kGenericMusicResBitsLongList = 8;                            {  Long back to back bitmaps of controllers, gminstruments, and drums  }
  418.     kGenericMusicResModifiableInstrumentHW = 9;                    {  Shrt same as the hw shorts trailing the instrument names, a shortlist  }
  419.     kGenericMusicResGMTranslation = 10;                            {  Long 128 long entries, 1 for each gm inst, of local instrument numbers 1-n (not hw numbers)  }
  420.     kGenericMusicResROMInstrumentData = 11;                        {  knob lists for ROM instruments, so the knob values may be known  }
  421.     kGenericMusicResAboutPICT    = 12;                            {  picture for aboutlist. must be present for GetAbout call to work  }
  422.     kGenericMusicResLast        = 13;
  423.  
  424. {  elements of the misc long list  }
  425.     kGenericMusicMiscLongFirst    = 0;
  426.     kGenericMusicMiscLongVoiceCount = 1;
  427.     kGenericMusicMiscLongPartCount = 2;
  428.     kGenericMusicMiscLongModifiableInstrumentCount = 3;
  429.     kGenericMusicMiscLongChannelMask = 4;
  430.     kGenericMusicMiscLongDrumPartCount = 5;
  431.     kGenericMusicMiscLongModifiableDrumCount = 6;
  432.     kGenericMusicMiscLongDrumChannelMask = 7;
  433.     kGenericMusicMiscLongOutputCount = 8;
  434.     kGenericMusicMiscLongLatency = 9;
  435.     kGenericMusicMiscLongFlags    = 10;
  436.     kGenericMusicMiscLongFirstGMHW = 11;                        {  number to add to locate GM main instruments  }
  437.     kGenericMusicMiscLongFirstGMDrumHW = 12;                    {  number to add to locate GM drumkits  }
  438.     kGenericMusicMiscLongFirstUserHW = 13;                        {  First hw number of user instruments (presumed sequential)  }
  439.     kGenericMusicMiscLongLast    = 14;
  440.  
  441.  
  442. TYPE
  443.     GCPartPtr = ^GCPart;
  444.     GCPart = RECORD
  445.         hwInstrumentNumber:        LONGINT;                                {  internal number of recalled instrument  }
  446.         controller:                ARRAY [0..127] OF INTEGER;                {  current values for all controllers  }
  447.         volume:                    LONGINT;                                {  ctrl 7 is special case  }
  448.         polyphony:                LONGINT;
  449.         midiChannel:            LONGINT;                                {  1-16 if in use  }
  450.         id:                        GCInstrumentData;                        {  ToneDescription & knoblist, uncertain length  }
  451.     END;
  452.  
  453. {
  454.  * Calls specific to the GenericMusicComponent
  455. }
  456.  
  457. CONST
  458.     kMusicGenericRange            = $0100;
  459.     kMusicDerivedRange            = $0200;
  460.  
  461. {
  462.  * Flags in GenericMusicConfigure call
  463. }
  464.     kGenericMusicDoMIDI            = $01;                            {  implement normal MIDI messages for note, controllers, and program changes 0-127  }
  465.     kGenericMusicBank0            = $02;                            {  implement instrument bank changes on controller 0  }
  466.     kGenericMusicBank32            = $04;                            {  implement instrument bank changes on controller 32  }
  467.     kGenericMusicErsatzMIDI        = $08;                            {  construct MIDI packets, but send them to the derived component  }
  468.     kGenericMusicCallKnobs        = $10;                            {  call the derived component with special knob format call  }
  469.     kGenericMusicCallParts        = $20;                            {  call the derived component with special part format call  }
  470.     kGenericMusicCallInstrument    = $40;                            {  call MusicDerivedSetInstrument for MusicSetInstrument calls  }
  471.     kGenericMusicCallNumber        = $80;                            {  call MusicDerivedSetPartInstrumentNumber for MusicSetPartInstrumentNumber calls, & don't send any C0 or bank stuff  }
  472.     kGenericMusicCallROMInstrument = $0100;                        {  call MusicSetInstrument for MusicSetPartInstrumentNumber for "ROM" instruments, passing params from the ROMi resource  }
  473.     kGenericMusicAllDefaults    = $0200;                        {  indicates that when a new instrument is recalled, all knobs are reset to DEFAULT settings. True for GS modules  }
  474.  
  475.  
  476. TYPE
  477.     MusicOfflineDataProcPtr = ProcPtr;  { FUNCTION MusicOfflineData(SoundData: Ptr; numBytes: LONGINT; myRefCon: LONGINT): ComponentResult; }
  478.  
  479.     MusicOfflineDataUPP = UniversalProcPtr;
  480.  
  481. TYPE
  482.     OfflineSampleTypePtr = ^OfflineSampleType;
  483.     OfflineSampleType = RECORD
  484.         numChannels:            LONGINT;                                { number of channels,  ie mono = 1 }
  485.         sampleRate:                UnsignedFixed;                            { sample rate in Apples Fixed point representation }
  486.         sampleSize:                INTEGER;                                { number of bits in sample }
  487.     END;
  488.  
  489.  
  490. TYPE
  491.     InstrumentInfoRecordPtr = ^InstrumentInfoRecord;
  492.     InstrumentInfoRecord = RECORD
  493.         instrumentNumber:        LONGINT;                                {  instrument number (if 0, name is a catagory) }
  494.         flags:                    LONGINT;                                {  show in picker, etc. }
  495.         toneNameIndex:            LONGINT;                                {  index in toneNames (1 based) }
  496.         itxtNameAtomID:            LONGINT;                                {  index in itxtNames (itxt/name by index) }
  497.     END;
  498.  
  499.     InstrumentInfoListPtr = ^InstrumentInfoList;
  500.     InstrumentInfoList = RECORD
  501.         recordCount:            LONGINT;
  502.         toneNames:                Handle;                                    {  name from tone description }
  503.         itxtNames:                QTAtomContainer;                        {  itxt/name atoms for instruments }
  504.         info:                    ARRAY [0..0] OF InstrumentInfoRecord;
  505.     END;
  506.  
  507.     InstrumentInfoListHandle            = ^InstrumentInfoListPtr;
  508. FUNCTION MusicGetDescription(mc: MusicComponent; VAR sd: SynthesizerDescription): ComponentResult;
  509.     {$IFC NOT GENERATINGCFM}
  510.     INLINE $2F3C, $0004, $0001, $7000, $A82A;
  511.     {$ENDC}
  512. FUNCTION MusicGetPart(mc: MusicComponent; part: LONGINT; VAR midiChannel: LONGINT; VAR polyphony: LONGINT): ComponentResult;
  513.     {$IFC NOT GENERATINGCFM}
  514.     INLINE $2F3C, $000C, $0002, $7000, $A82A;
  515.     {$ENDC}
  516. FUNCTION MusicSetPart(mc: MusicComponent; part: LONGINT; midiChannel: LONGINT; polyphony: LONGINT): ComponentResult;
  517.     {$IFC NOT GENERATINGCFM}
  518.     INLINE $2F3C, $000C, $0003, $7000, $A82A;
  519.     {$ENDC}
  520. FUNCTION MusicSetPartInstrumentNumber(mc: MusicComponent; part: LONGINT; instrumentNumber: LONGINT): ComponentResult;
  521.     {$IFC NOT GENERATINGCFM}
  522.     INLINE $2F3C, $0008, $0004, $7000, $A82A;
  523.     {$ENDC}
  524. FUNCTION MusicGetPartInstrumentNumber(mc: MusicComponent; part: LONGINT): ComponentResult;
  525.     {$IFC NOT GENERATINGCFM}
  526.     INLINE $2F3C, $0004, $0005, $7000, $A82A;
  527.     {$ENDC}
  528. FUNCTION MusicStorePartInstrument(mc: MusicComponent; part: LONGINT; instrumentNumber: LONGINT): ComponentResult;
  529.     {$IFC NOT GENERATINGCFM}
  530.     INLINE $2F3C, $0008, $0006, $7000, $A82A;
  531.     {$ENDC}
  532. FUNCTION MusicGetPartAtomicInstrument(mc: MusicComponent; part: LONGINT; VAR ai: AtomicInstrument; flags: LONGINT): ComponentResult;
  533.     {$IFC NOT GENERATINGCFM}
  534.     INLINE $2F3C, $000C, $0009, $7000, $A82A;
  535.     {$ENDC}
  536. FUNCTION MusicSetPartAtomicInstrument(mc: MusicComponent; part: LONGINT; aiP: AtomicInstrumentPtr; flags: LONGINT): ComponentResult;
  537.     {$IFC NOT GENERATINGCFM}
  538.     INLINE $2F3C, $000C, $000A, $7000, $A82A;
  539.     {$ENDC}
  540. {  Obsolete calls }
  541. FUNCTION MusicGetInstrumentKnobDescriptionObsolete(mc: MusicComponent; knobIndex: LONGINT; mkd: UNIV Ptr): ComponentResult;
  542.     {$IFC NOT GENERATINGCFM}
  543.     INLINE $2F3C, $0008, $000D, $7000, $A82A;
  544.     {$ENDC}
  545. FUNCTION MusicGetDrumKnobDescriptionObsolete(mc: MusicComponent; knobIndex: LONGINT; mkd: UNIV Ptr): ComponentResult;
  546.     {$IFC NOT GENERATINGCFM}
  547.     INLINE $2F3C, $0008, $000E, $7000, $A82A;
  548.     {$ENDC}
  549. FUNCTION MusicGetKnobDescriptionObsolete(mc: MusicComponent; knobIndex: LONGINT; mkd: UNIV Ptr): ComponentResult;
  550.     {$IFC NOT GENERATINGCFM}
  551.     INLINE $2F3C, $0008, $000F, $7000, $A82A;
  552.     {$ENDC}
  553. FUNCTION MusicGetPartKnob(mc: MusicComponent; part: LONGINT; knobID: LONGINT): ComponentResult;
  554.     {$IFC NOT GENERATINGCFM}
  555.     INLINE $2F3C, $0008, $0010, $7000, $A82A;
  556.     {$ENDC}
  557. FUNCTION MusicSetPartKnob(mc: MusicComponent; part: LONGINT; knobID: LONGINT; knobValue: LONGINT): ComponentResult;
  558.     {$IFC NOT GENERATINGCFM}
  559.     INLINE $2F3C, $000C, $0011, $7000, $A82A;
  560.     {$ENDC}
  561. FUNCTION MusicGetKnob(mc: MusicComponent; knobID: LONGINT): ComponentResult;
  562.     {$IFC NOT GENERATINGCFM}
  563.     INLINE $2F3C, $0004, $0012, $7000, $A82A;
  564.     {$ENDC}
  565. FUNCTION MusicSetKnob(mc: MusicComponent; knobID: LONGINT; knobValue: LONGINT): ComponentResult;
  566.     {$IFC NOT GENERATINGCFM}
  567.     INLINE $2F3C, $0008, $0013, $7000, $A82A;
  568.     {$ENDC}
  569. FUNCTION MusicGetPartName(mc: MusicComponent; part: LONGINT; name: StringPtr): ComponentResult;
  570.     {$IFC NOT GENERATINGCFM}
  571.     INLINE $2F3C, $0008, $0014, $7000, $A82A;
  572.     {$ENDC}
  573. FUNCTION MusicSetPartName(mc: MusicComponent; part: LONGINT; name: StringPtr): ComponentResult;
  574.     {$IFC NOT GENERATINGCFM}
  575.     INLINE $2F3C, $0008, $0015, $7000, $A82A;
  576.     {$ENDC}
  577. FUNCTION MusicFindTone(mc: MusicComponent; VAR td: ToneDescription; VAR instrumentNumber: LONGINT; VAR fit: LONGINT): ComponentResult;
  578.     {$IFC NOT GENERATINGCFM}
  579.     INLINE $2F3C, $000C, $0016, $7000, $A82A;
  580.     {$ENDC}
  581. FUNCTION MusicPlayNote(mc: MusicComponent; part: LONGINT; pitch: LONGINT; velocity: LONGINT): ComponentResult;
  582.     {$IFC NOT GENERATINGCFM}
  583.     INLINE $2F3C, $000C, $0017, $7000, $A82A;
  584.     {$ENDC}
  585. FUNCTION MusicResetPart(mc: MusicComponent; part: LONGINT): ComponentResult;
  586.     {$IFC NOT GENERATINGCFM}
  587.     INLINE $2F3C, $0004, $0018, $7000, $A82A;
  588.     {$ENDC}
  589. FUNCTION MusicSetPartController(mc: MusicComponent; part: LONGINT; controllerNumber: MusicController; controllerValue: LONGINT): ComponentResult;
  590.     {$IFC NOT GENERATINGCFM}
  591.     INLINE $2F3C, $000C, $0019, $7000, $A82A;
  592.     {$ENDC}
  593. FUNCTION MusicGetPartController(mc: MusicComponent; part: LONGINT; controllerNumber: MusicController): ComponentResult;
  594.     {$IFC NOT GENERATINGCFM}
  595.     INLINE $2F3C, $0008, $001A, $7000, $A82A;
  596.     {$ENDC}
  597. FUNCTION MusicGetMIDIProc(mc: MusicComponent; VAR midiSendProc: MusicMIDISendUPP; VAR refCon: LONGINT): ComponentResult;
  598.     {$IFC NOT GENERATINGCFM}
  599.     INLINE $2F3C, $0008, $001B, $7000, $A82A;
  600.     {$ENDC}
  601. FUNCTION MusicSetMIDIProc(mc: MusicComponent; midiSendProc: MusicMIDISendUPP; refCon: LONGINT): ComponentResult;
  602.     {$IFC NOT GENERATINGCFM}
  603.     INLINE $2F3C, $0008, $001C, $7000, $A82A;
  604.     {$ENDC}
  605. FUNCTION MusicGetInstrumentNames(mc: MusicComponent; modifiableInstruments: LONGINT; VAR instrumentNames: Handle; VAR instrumentCategoryLasts: Handle; VAR instrumentCategoryNames: Handle): ComponentResult;
  606.     {$IFC NOT GENERATINGCFM}
  607.     INLINE $2F3C, $0010, $001D, $7000, $A82A;
  608.     {$ENDC}
  609. FUNCTION MusicGetDrumNames(mc: MusicComponent; modifiableInstruments: LONGINT; VAR instrumentNumbers: Handle; VAR instrumentNames: Handle): ComponentResult;
  610.     {$IFC NOT GENERATINGCFM}
  611.     INLINE $2F3C, $000C, $001E, $7000, $A82A;
  612.     {$ENDC}
  613. FUNCTION MusicGetMasterTune(mc: MusicComponent): ComponentResult;
  614.     {$IFC NOT GENERATINGCFM}
  615.     INLINE $2F3C, $0000, $001F, $7000, $A82A;
  616.     {$ENDC}
  617. FUNCTION MusicSetMasterTune(mc: MusicComponent; masterTune: LONGINT): ComponentResult;
  618.     {$IFC NOT GENERATINGCFM}
  619.     INLINE $2F3C, $0004, $0020, $7000, $A82A;
  620.     {$ENDC}
  621. FUNCTION MusicGetInstrumentAboutInfo(mc: MusicComponent; part: LONGINT; VAR iai: InstrumentAboutInfo): ComponentResult;
  622.     {$IFC NOT GENERATINGCFM}
  623.     INLINE $2F3C, $0008, $0022, $7000, $A82A;
  624.     {$ENDC}
  625. FUNCTION MusicGetDeviceConnection(mc: MusicComponent; index: LONGINT; VAR id1: LONGINT; VAR id2: LONGINT): ComponentResult;
  626.     {$IFC NOT GENERATINGCFM}
  627.     INLINE $2F3C, $000C, $0023, $7000, $A82A;
  628.     {$ENDC}
  629. FUNCTION MusicUseDeviceConnection(mc: MusicComponent; id1: LONGINT; id2: LONGINT): ComponentResult;
  630.     {$IFC NOT GENERATINGCFM}
  631.     INLINE $2F3C, $0008, $0024, $7000, $A82A;
  632.     {$ENDC}
  633. FUNCTION MusicGetKnobSettingStrings(mc: MusicComponent; knobIndex: LONGINT; isGlobal: LONGINT; VAR settingsNames: Handle; VAR settingsCategoryLasts: Handle; VAR settingsCategoryNames: Handle): ComponentResult;
  634.     {$IFC NOT GENERATINGCFM}
  635.     INLINE $2F3C, $0014, $0025, $7000, $A82A;
  636.     {$ENDC}
  637. FUNCTION MusicGetMIDIPorts(mc: MusicComponent; VAR inputPortCount: LONGINT; VAR outputPortCount: LONGINT): ComponentResult;
  638.     {$IFC NOT GENERATINGCFM}
  639.     INLINE $2F3C, $0008, $0026, $7000, $A82A;
  640.     {$ENDC}
  641. FUNCTION MusicSendMIDI(mc: MusicComponent; portIndex: LONGINT; VAR mp: MusicMIDIPacket): ComponentResult;
  642.     {$IFC NOT GENERATINGCFM}
  643.     INLINE $2F3C, $0008, $0027, $7000, $A82A;
  644.     {$ENDC}
  645. FUNCTION MusicReceiveMIDI(mc: MusicComponent; readHook: MusicMIDIReadHookUPP; refCon: LONGINT): ComponentResult;
  646.     {$IFC NOT GENERATINGCFM}
  647.     INLINE $2F3C, $0008, $0028, $7000, $A82A;
  648.     {$ENDC}
  649. FUNCTION MusicStartOffline(mc: MusicComponent; VAR numChannels: LONGINT; VAR sampleRate: UnsignedFixed; VAR sampleSize: INTEGER; dataProc: MusicOfflineDataUPP; dataProcRefCon: LONGINT): ComponentResult;
  650.     {$IFC NOT GENERATINGCFM}
  651.     INLINE $2F3C, $0014, $0029, $7000, $A82A;
  652.     {$ENDC}
  653. FUNCTION MusicSetOfflineTimeTo(mc: MusicComponent; newTimeStamp: LONGINT): ComponentResult;
  654.     {$IFC NOT GENERATINGCFM}
  655.     INLINE $2F3C, $0004, $002A, $7000, $A82A;
  656.     {$ENDC}
  657. FUNCTION MusicGetInstrumentKnobDescription(mc: MusicComponent; knobIndex: LONGINT; VAR mkd: KnobDescription): ComponentResult;
  658.     {$IFC NOT GENERATINGCFM}
  659.     INLINE $2F3C, $0008, $002B, $7000, $A82A;
  660.     {$ENDC}
  661. FUNCTION MusicGetDrumKnobDescription(mc: MusicComponent; knobIndex: LONGINT; VAR mkd: KnobDescription): ComponentResult;
  662.     {$IFC NOT GENERATINGCFM}
  663.     INLINE $2F3C, $0008, $002C, $7000, $A82A;
  664.     {$ENDC}
  665. FUNCTION MusicGetKnobDescription(mc: MusicComponent; knobIndex: LONGINT; VAR mkd: KnobDescription): ComponentResult;
  666.     {$IFC NOT GENERATINGCFM}
  667.     INLINE $2F3C, $0008, $002D, $7000, $A82A;
  668.     {$ENDC}
  669. FUNCTION MusicGetInfoText(mc: MusicComponent; selector: LONGINT; VAR textH: Handle; VAR styleH: Handle): ComponentResult;
  670.     {$IFC NOT GENERATINGCFM}
  671.     INLINE $2F3C, $000C, $002E, $7000, $A82A;
  672.     {$ENDC}
  673.  
  674. CONST
  675.     kGetInstrumentInfoNoBuiltIn    = $01;
  676.     kGetInstrumentInfoMidiUserInst = $02;
  677.     kGetInstrumentInfoNoIText    = $04;
  678.  
  679. FUNCTION MusicGetInstrumentInfo(mc: MusicComponent; getInstrumentInfoFlags: LONGINT; VAR infoListH: InstrumentInfoListHandle): ComponentResult;
  680.     {$IFC NOT GENERATINGCFM}
  681.     INLINE $2F3C, $0008, $002F, $7000, $A82A;
  682.     {$ENDC}
  683. FUNCTION MusicTask(mc: MusicComponent): ComponentResult;
  684.     {$IFC NOT GENERATINGCFM}
  685.     INLINE $2F3C, $0000, $0031, $7000, $A82A;
  686.     {$ENDC}
  687. FUNCTION MusicSetPartInstrumentNumberInterruptSafe(mc: MusicComponent; part: LONGINT; instrumentNumber: LONGINT): ComponentResult;
  688.     {$IFC NOT GENERATINGCFM}
  689.     INLINE $2F3C, $0008, $0032, $7000, $A82A;
  690.     {$ENDC}
  691. FUNCTION MusicSetPartSoundLocalization(mc: MusicComponent; part: LONGINT; data: Handle): ComponentResult;
  692.     {$IFC NOT GENERATINGCFM}
  693.     INLINE $2F3C, $0008, $0033, $7000, $A82A;
  694.     {$ENDC}
  695. FUNCTION MusicGenericConfigure(mc: MusicComponent; mode: LONGINT; flags: LONGINT; baseResID: LONGINT): ComponentResult;
  696.     {$IFC NOT GENERATINGCFM}
  697.     INLINE $2F3C, $000C, $0100, $7000, $A82A;
  698.     {$ENDC}
  699. FUNCTION MusicGenericGetPart(mc: MusicComponent; partNumber: LONGINT; VAR part: GCPartPtr): ComponentResult;
  700.     {$IFC NOT GENERATINGCFM}
  701.     INLINE $2F3C, $0008, $0101, $7000, $A82A;
  702.     {$ENDC}
  703. FUNCTION MusicGenericGetKnobList(mc: MusicComponent; knobType: LONGINT; VAR gkdlH: GenericKnobDescriptionListHandle): ComponentResult;
  704.     {$IFC NOT GENERATINGCFM}
  705.     INLINE $2F3C, $0008, $0102, $7000, $A82A;
  706.     {$ENDC}
  707. FUNCTION MusicDerivedMIDISend(mc: MusicComponent; VAR packet: MusicMIDIPacket): ComponentResult;
  708.     {$IFC NOT GENERATINGCFM}
  709.     INLINE $2F3C, $0004, $0200, $7000, $A82A;
  710.     {$ENDC}
  711. FUNCTION MusicDerivedSetKnob(mc: MusicComponent; knobType: LONGINT; knobNumber: LONGINT; knobValue: LONGINT; partNumber: LONGINT; VAR p: GCPart; VAR gkd: GenericKnobDescription): ComponentResult;
  712.     {$IFC NOT GENERATINGCFM}
  713.     INLINE $2F3C, $0018, $0201, $7000, $A82A;
  714.     {$ENDC}
  715. FUNCTION MusicDerivedSetPart(mc: MusicComponent; partNumber: LONGINT; VAR p: GCPart): ComponentResult;
  716.     {$IFC NOT GENERATINGCFM}
  717.     INLINE $2F3C, $0008, $0202, $7000, $A82A;
  718.     {$ENDC}
  719. FUNCTION MusicDerivedSetInstrument(mc: MusicComponent; partNumber: LONGINT; VAR p: GCPart): ComponentResult;
  720.     {$IFC NOT GENERATINGCFM}
  721.     INLINE $2F3C, $0008, $0203, $7000, $A82A;
  722.     {$ENDC}
  723. FUNCTION MusicDerivedSetPartInstrumentNumber(mc: MusicComponent; partNumber: LONGINT; VAR p: GCPart): ComponentResult;
  724.     {$IFC NOT GENERATINGCFM}
  725.     INLINE $2F3C, $0008, $0204, $7000, $A82A;
  726.     {$ENDC}
  727. FUNCTION MusicDerivedSetMIDI(mc: MusicComponent; midiProc: MusicMIDISendProcPtr; refcon: LONGINT; midiChannel: LONGINT): ComponentResult;
  728.     {$IFC NOT GENERATINGCFM}
  729.     INLINE $2F3C, $000C, $0205, $7000, $A82A;
  730.     {$ENDC}
  731. FUNCTION MusicDerivedStorePartInstrument(mc: MusicComponent; partNumber: LONGINT; VAR p: GCPart; instrumentNumber: LONGINT): ComponentResult;
  732.     {$IFC NOT GENERATINGCFM}
  733.     INLINE $2F3C, $000C, $0206, $7000, $A82A;
  734.     {$ENDC}
  735. {  Mask bit for returned value by InstrumentFind. }
  736.  
  737. CONST
  738.     kInstrumentExactMatch        = $00020000;
  739.     kInstrumentRecommendedSubstitute = $00010000;
  740.     kInstrumentQualityField        = $FF000000;
  741.     kInstrumentRoland8BitQuality = $05000000;
  742.  
  743.  
  744. TYPE
  745.     InstrumentAboutInfoHandle            = ^InstrumentAboutInfoPtr;
  746.     GMInstrumentInfoPtr = ^GMInstrumentInfo;
  747.     GMInstrumentInfo = RECORD
  748.         cmpInstID:                LONGINT;
  749.         gmInstNum:                LONGINT;
  750.         instMatch:                LONGINT;
  751.     END;
  752.  
  753.     GMInstrumentInfoHandle                = ^GMInstrumentInfoPtr;
  754.     nonGMInstrumentInfoRecordPtr = ^nonGMInstrumentInfoRecord;
  755.     nonGMInstrumentInfoRecord = RECORD
  756.         cmpInstID:                LONGINT;                                {  if 0, category name }
  757.         flags:                    LONGINT;                                {  match, show in picker }
  758.         toneNameIndex:            LONGINT;                                {  index in toneNames (1 based) }
  759.         itxtNameAtomID:            LONGINT;                                {  index in itxtNames (itxt/name by index) }
  760.     END;
  761.  
  762.     nonGMInstrumentInfoPtr = ^nonGMInstrumentInfo;
  763.     nonGMInstrumentInfo = RECORD
  764.         recordCount:            LONGINT;
  765.         toneNames:                Handle;                                    {  name from tone description }
  766.         itxtNames:                QTAtomContainer;                        {  itext/name atoms for instruments }
  767.         instInfo:                ARRAY [0..0] OF nonGMInstrumentInfoRecord;
  768.     END;
  769.  
  770.     nonGMInstrumentInfoHandle            = ^nonGMInstrumentInfoPtr;
  771.     InstCompInfoPtr = ^InstCompInfo;
  772.     InstCompInfo = RECORD
  773.         infoSize:                LONGINT;                                {  size of this record }
  774.         InstrumentLibraryName:    Str31;
  775.         InstrumentLibraryITxt:    QTAtomContainer;                        {  itext/name atoms for instruments }
  776.         GMinstrumentCount:        LONGINT;
  777.         GMinstrumentInfo:        GMInstrumentInfoHandle;
  778.         GMdrumCount:            LONGINT;
  779.         GMdrumInfo:                GMInstrumentInfoHandle;
  780.         nonGMinstrumentCount:    LONGINT;
  781.         nonGMinstrumentInfo:    nonGMInstrumentInfoHandle;
  782.     END;
  783.  
  784.     InstCompInfoHandle                    = ^InstCompInfoPtr;
  785. FUNCTION InstrumentGetInst(ci: ComponentInstance; instID: LONGINT; VAR atomicInst: AtomicInstrument; flags: LONGINT): ComponentResult;
  786.     {$IFC NOT GENERATINGCFM}
  787.     INLINE $2F3C, $000C, $0001, $7000, $A82A;
  788.     {$ENDC}
  789. FUNCTION InstrumentGetInfo(ci: ComponentInstance; getInstrumentInfoFlags: LONGINT; VAR instInfo: InstCompInfoHandle): ComponentResult;
  790.     {$IFC NOT GENERATINGCFM}
  791.     INLINE $2F3C, $0008, $0002, $7000, $A82A;
  792.     {$ENDC}
  793. FUNCTION InstrumentInitialize(ci: ComponentInstance; initFormat: LONGINT; initParams: UNIV Ptr): ComponentResult;
  794.     {$IFC NOT GENERATINGCFM}
  795.     INLINE $2F3C, $0008, $0003, $7000, $A82A;
  796.     {$ENDC}
  797. FUNCTION InstrumentOpenComponentResFile(ci: ComponentInstance; VAR resFile: INTEGER): ComponentResult;
  798.     {$IFC NOT GENERATINGCFM}
  799.     INLINE $2F3C, $0004, $0004, $7000, $A82A;
  800.     {$ENDC}
  801. FUNCTION InstrumentCloseComponentResFile(ci: ComponentInstance; resFile: INTEGER): ComponentResult;
  802.     {$IFC NOT GENERATINGCFM}
  803.     INLINE $2F3C, $0002, $0005, $7000, $A82A;
  804.     {$ENDC}
  805. FUNCTION InstrumentGetComponentRefCon(ci: ComponentInstance; VAR refCon: UNIV Ptr): ComponentResult;
  806.     {$IFC NOT GENERATINGCFM}
  807.     INLINE $2F3C, $0004, $0006, $7000, $A82A;
  808.     {$ENDC}
  809. FUNCTION InstrumentSetComponentRefCon(ci: ComponentInstance; refCon: UNIV Ptr): ComponentResult;
  810.     {$IFC NOT GENERATINGCFM}
  811.     INLINE $2F3C, $0004, $0007, $7000, $A82A;
  812.     {$ENDC}
  813. {
  814. --------------------------
  815.     Types
  816. --------------------------
  817. }
  818.  
  819. CONST
  820.     kSynthesizerConnectionMono    = 1;                            {  if set, and synth can be mono/poly, then the partCount channels from the system channel are hogged  }
  821.     kSynthesizerConnectionMMgr    = 2;                            {  this connection imported from the MIDI Mgr  }
  822.     kSynthesizerConnectionOMS    = 4;                            {  this connection imported from OMS  }
  823.     kSynthesizerConnectionQT    = 8;                            {  this connection is a QuickTime-only port  }
  824.     kSynthesizerConnectionFMS    = 16;                            {  this connection imported from FMS  }
  825.  
  826. {  used for MIDI device only  }
  827.  
  828. TYPE
  829.     SynthesizerConnectionsPtr = ^SynthesizerConnections;
  830.     SynthesizerConnections = RECORD
  831.         clientID:                OSType;
  832.         inputPortID:            OSType;                                    {  terminology death: this port is used to SEND to the midi synth  }
  833.         outputPortID:            OSType;                                    {  terminology death: this port receives from a keyboard or other control device  }
  834.         midiChannel:            LONGINT;                                {  The system channel; others are configurable (or the nubus slot number)  }
  835.         flags:                    LONGINT;
  836.         unique:                    LONGINT;                                {  unique id may be used instead of index, to getinfo and unregister calls  }
  837.         reserved1:                LONGINT;                                {  should be zero  }
  838.         reserved2:                LONGINT;                                {  should be zero  }
  839.     END;
  840.  
  841.     QTMIDIPortPtr = ^QTMIDIPort;
  842.     QTMIDIPort = RECORD
  843.         portConnections:        SynthesizerConnections;
  844.         portName:                Str63;
  845.     END;
  846.  
  847.  
  848. CONST
  849.     kNoteRequestNoGM            = 1;                            {  dont degrade to a GM synth  }
  850.     kNoteRequestNoSynthType        = 2;                            {  dont degrade to another synth of same type but different name  }
  851.     kNoteRequestSynthMustMatch    = 4;                            {  synthType must be a match, including kGMSynthComponentSubType  }
  852.  
  853.  
  854. TYPE
  855.     NoteAllocator                        = ComponentInstance;
  856.     NoteRequestInfoPtr = ^NoteRequestInfo;
  857.     NoteRequestInfo = RECORD
  858.         flags:                    SInt8;                                    {  1: dont accept GM match, 2: dont accept same-synth-type match  }
  859.         reserved:                SInt8;                                    {  must be zero  }
  860.         polyphony:                INTEGER;                                {  Maximum number of voices  }
  861.         typicalPolyphony:        Fixed;                                    {  Hint for level mixing  }
  862.     END;
  863.  
  864.     NoteRequestPtr = ^NoteRequest;
  865.     NoteRequest = RECORD
  866.         info:                    NoteRequestInfo;
  867.         tone:                    ToneDescription;
  868.     END;
  869.  
  870.     NoteChannel = ^LONGINT;
  871.  
  872. CONST
  873.     kPickDontMix                = 1;                            {  dont mix instruments with drum sounds  }
  874.     kPickSameSynth                = 2;                            {  only allow the same device that went in, to come out  }
  875.     kPickUserInsts                = 4;                            {  show user insts in addition to ROM voices  }
  876.     kPickEditAllowEdit            = 8;                            {  lets user switch over to edit mode  }
  877.     kPickEditAllowPick            = 16;                            {  lets the user switch over to pick mode  }
  878.     kPickEditSynthGlobal        = 32;                            {  edit the global knobs of the synth  }
  879.     kPickEditControllers        = 64;                            {  edit the controllers of the notechannel  }
  880.  
  881.     kNoteAllocatorComponentType    = 'nota';
  882.  
  883. {
  884. --------------------------------
  885.     Note Allocator Prototypes
  886. --------------------------------
  887. }
  888. FUNCTION NARegisterMusicDevice(ci: NoteAllocator; synthType: OSType; VAR name: Str31; VAR connections: SynthesizerConnections): ComponentResult;
  889.     {$IFC NOT GENERATINGCFM}
  890.     INLINE $2F3C, $000C, $0000, $7000, $A82A;
  891.     {$ENDC}
  892. FUNCTION NAUnregisterMusicDevice(ci: NoteAllocator; index: LONGINT): ComponentResult;
  893.     {$IFC NOT GENERATINGCFM}
  894.     INLINE $2F3C, $0004, $0001, $7000, $A82A;
  895.     {$ENDC}
  896. FUNCTION NAGetRegisteredMusicDevice(ci: NoteAllocator; index: LONGINT; VAR synthType: OSType; VAR name: Str31; VAR connections: SynthesizerConnections; VAR mc: MusicComponent): ComponentResult;
  897.     {$IFC NOT GENERATINGCFM}
  898.     INLINE $2F3C, $0014, $0002, $7000, $A82A;
  899.     {$ENDC}
  900. FUNCTION NASaveMusicConfiguration(ci: NoteAllocator): ComponentResult;
  901.     {$IFC NOT GENERATINGCFM}
  902.     INLINE $2F3C, $0000, $0003, $7000, $A82A;
  903.     {$ENDC}
  904. FUNCTION NANewNoteChannel(ci: NoteAllocator; VAR noteRequest: NoteRequest; VAR outChannel: NoteChannel): ComponentResult;
  905.     {$IFC NOT GENERATINGCFM}
  906.     INLINE $2F3C, $0008, $0004, $7000, $A82A;
  907.     {$ENDC}
  908. FUNCTION NADisposeNoteChannel(ci: NoteAllocator; noteChannel: NoteChannel): ComponentResult;
  909.     {$IFC NOT GENERATINGCFM}
  910.     INLINE $2F3C, $0004, $0005, $7000, $A82A;
  911.     {$ENDC}
  912. FUNCTION NAGetNoteChannelInfo(ci: NoteAllocator; noteChannel: NoteChannel; VAR index: LONGINT; VAR part: LONGINT): ComponentResult;
  913.     {$IFC NOT GENERATINGCFM}
  914.     INLINE $2F3C, $000C, $0006, $7000, $A82A;
  915.     {$ENDC}
  916. FUNCTION NAPrerollNoteChannel(ci: NoteAllocator; noteChannel: NoteChannel): ComponentResult;
  917.     {$IFC NOT GENERATINGCFM}
  918.     INLINE $2F3C, $0004, $0007, $7000, $A82A;
  919.     {$ENDC}
  920. FUNCTION NAUnrollNoteChannel(ci: NoteAllocator; noteChannel: NoteChannel): ComponentResult;
  921.     {$IFC NOT GENERATINGCFM}
  922.     INLINE $2F3C, $0004, $0008, $7000, $A82A;
  923.     {$ENDC}
  924. FUNCTION NASetNoteChannelVolume(ci: NoteAllocator; noteChannel: NoteChannel; volume: Fixed): ComponentResult;
  925.     {$IFC NOT GENERATINGCFM}
  926.     INLINE $2F3C, $0008, $000B, $7000, $A82A;
  927.     {$ENDC}
  928. FUNCTION NAResetNoteChannel(ci: NoteAllocator; noteChannel: NoteChannel): ComponentResult;
  929.     {$IFC NOT GENERATINGCFM}
  930.     INLINE $2F3C, $0004, $000C, $7000, $A82A;
  931.     {$ENDC}
  932. FUNCTION NAPlayNote(ci: NoteAllocator; noteChannel: NoteChannel; pitch: LONGINT; velocity: LONGINT): ComponentResult;
  933.     {$IFC NOT GENERATINGCFM}
  934.     INLINE $2F3C, $000C, $000D, $7000, $A82A;
  935.     {$ENDC}
  936. FUNCTION NASetController(ci: NoteAllocator; noteChannel: NoteChannel; controllerNumber: LONGINT; controllerValue: LONGINT): ComponentResult;
  937.     {$IFC NOT GENERATINGCFM}
  938.     INLINE $2F3C, $000C, $000E, $7000, $A82A;
  939.     {$ENDC}
  940. FUNCTION NASetKnob(ci: NoteAllocator; noteChannel: NoteChannel; knobNumber: LONGINT; knobValue: LONGINT): ComponentResult;
  941.     {$IFC NOT GENERATINGCFM}
  942.     INLINE $2F3C, $000C, $000F, $7000, $A82A;
  943.     {$ENDC}
  944. FUNCTION NAFindNoteChannelTone(ci: NoteAllocator; noteChannel: NoteChannel; VAR td: ToneDescription; VAR instrumentNumber: LONGINT): ComponentResult;
  945.     {$IFC NOT GENERATINGCFM}
  946.     INLINE $2F3C, $000C, $0010, $7000, $A82A;
  947.     {$ENDC}
  948. FUNCTION NASetInstrumentNumber(ci: NoteAllocator; noteChannel: NoteChannel; instrumentNumber: LONGINT): ComponentResult;
  949.     {$IFC NOT GENERATINGCFM}
  950.     INLINE $2F3C, $0008, $0011, $7000, $A82A;
  951.     {$ENDC}
  952. FUNCTION NAPickInstrument(ci: NoteAllocator; filterProc: ModalFilterUPP; prompt: StringPtr; VAR sd: ToneDescription; flags: LONGINT; refCon: LONGINT; reserved1: LONGINT; reserved2: LONGINT): ComponentResult;
  953.     {$IFC NOT GENERATINGCFM}
  954.     INLINE $2F3C, $001C, $0012, $7000, $A82A;
  955.     {$ENDC}
  956. FUNCTION NAPickArrangement(ci: NoteAllocator; filterProc: ModalFilterUPP; prompt: StringPtr; zero1: LONGINT; zero2: LONGINT; t: Track; songName: StringPtr): ComponentResult;
  957.     {$IFC NOT GENERATINGCFM}
  958.     INLINE $2F3C, $0018, $0013, $7000, $A82A;
  959.     {$ENDC}
  960. FUNCTION NASetDefaultMIDIInput(ci: NoteAllocator; VAR sc: SynthesizerConnections): ComponentResult;
  961.     {$IFC NOT GENERATINGCFM}
  962.     INLINE $2F3C, $0004, $0015, $7000, $A82A;
  963.     {$ENDC}
  964. FUNCTION NAGetDefaultMIDIInput(ci: NoteAllocator; VAR sc: SynthesizerConnections): ComponentResult;
  965.     {$IFC NOT GENERATINGCFM}
  966.     INLINE $2F3C, $0004, $0016, $7000, $A82A;
  967.     {$ENDC}
  968. FUNCTION NAUseDefaultMIDIInput(ci: NoteAllocator; readHook: MusicMIDIReadHookUPP; refCon: LONGINT; flags: LONGINT): ComponentResult;
  969.     {$IFC NOT GENERATINGCFM}
  970.     INLINE $2F3C, $000C, $0019, $7000, $A82A;
  971.     {$ENDC}
  972. FUNCTION NALoseDefaultMIDIInput(ci: NoteAllocator): ComponentResult;
  973.     {$IFC NOT GENERATINGCFM}
  974.     INLINE $2F3C, $0000, $001A, $7000, $A82A;
  975.     {$ENDC}
  976. FUNCTION NAStuffToneDescription(ci: NoteAllocator; gmNumber: LONGINT; VAR td: ToneDescription): ComponentResult;
  977.     {$IFC NOT GENERATINGCFM}
  978.     INLINE $2F3C, $0008, $001B, $7000, $A82A;
  979.     {$ENDC}
  980. FUNCTION NACopyrightDialog(ci: NoteAllocator; p: PicHandle; author: StringPtr; copyright: StringPtr; other: StringPtr; title: StringPtr; filterProc: ModalFilterUPP; refCon: LONGINT): ComponentResult;
  981.     {$IFC NOT GENERATINGCFM}
  982.     INLINE $2F3C, $001C, $001C, $7000, $A82A;
  983.     {$ENDC}
  984. {
  985.     kNADummyOneSelect = 29
  986.     kNADummyTwoSelect = 30
  987. }
  988. FUNCTION NAGetIndNoteChannel(ci: NoteAllocator; index: LONGINT; VAR nc: NoteChannel; VAR seed: LONGINT): ComponentResult;
  989.     {$IFC NOT GENERATINGCFM}
  990.     INLINE $2F3C, $000C, $001F, $7000, $A82A;
  991.     {$ENDC}
  992. FUNCTION NAGetMIDIPorts(ci: NoteAllocator; VAR inputPorts: Handle; VAR outputPorts: Handle): ComponentResult;
  993.     {$IFC NOT GENERATINGCFM}
  994.     INLINE $2F3C, $0008, $0021, $7000, $A82A;
  995.     {$ENDC}
  996. FUNCTION NAGetNoteRequest(ci: NoteAllocator; noteChannel: NoteChannel; VAR nrOut: NoteRequest): ComponentResult;
  997.     {$IFC NOT GENERATINGCFM}
  998.     INLINE $2F3C, $0008, $0022, $7000, $A82A;
  999.     {$ENDC}
  1000. FUNCTION NASendMIDI(ci: NoteAllocator; noteChannel: NoteChannel; VAR mp: MusicMIDIPacket): ComponentResult;
  1001.     {$IFC NOT GENERATINGCFM}
  1002.     INLINE $2F3C, $0008, $0023, $7000, $A82A;
  1003.     {$ENDC}
  1004. FUNCTION NAPickEditInstrument(ci: NoteAllocator; filterProc: ModalFilterUPP; prompt: StringPtr; refCon: LONGINT; nc: NoteChannel; ai: AtomicInstrument; flags: LONGINT): ComponentResult;
  1005.     {$IFC NOT GENERATINGCFM}
  1006.     INLINE $2F3C, $0018, $0024, $7000, $A82A;
  1007.     {$ENDC}
  1008. FUNCTION NANewNoteChannelFromAtomicInstrument(ci: NoteAllocator; instrument: AtomicInstrumentPtr; flags: LONGINT; VAR outChannel: NoteChannel): ComponentResult;
  1009.     {$IFC NOT GENERATINGCFM}
  1010.     INLINE $2F3C, $000C, $0025, $7000, $A82A;
  1011.     {$ENDC}
  1012. FUNCTION NASetAtomicInstrument(ci: NoteAllocator; noteChannel: NoteChannel; instrument: AtomicInstrumentPtr; flags: LONGINT): ComponentResult;
  1013.     {$IFC NOT GENERATINGCFM}
  1014.     INLINE $2F3C, $000C, $0026, $7000, $A82A;
  1015.     {$ENDC}
  1016. FUNCTION NAGetKnob(ci: NoteAllocator; noteChannel: NoteChannel; knobNumber: LONGINT; VAR knobValue: LONGINT): ComponentResult;
  1017.     {$IFC NOT GENERATINGCFM}
  1018.     INLINE $2F3C, $000C, $0028, $7000, $A82A;
  1019.     {$ENDC}
  1020. FUNCTION NATask(ci: NoteAllocator): ComponentResult;
  1021.     {$IFC NOT GENERATINGCFM}
  1022.     INLINE $2F3C, $0000, $0029, $7000, $A82A;
  1023.     {$ENDC}
  1024. FUNCTION NASetNoteChannelBalance(ci: NoteAllocator; noteChannel: NoteChannel; balance: LONGINT): ComponentResult;
  1025.     {$IFC NOT GENERATINGCFM}
  1026.     INLINE $2F3C, $0008, $002A, $7000, $A82A;
  1027.     {$ENDC}
  1028. FUNCTION NASetInstrumentNumberInterruptSafe(ci: NoteAllocator; noteChannel: NoteChannel; instrumentNumber: LONGINT): ComponentResult;
  1029.     {$IFC NOT GENERATINGCFM}
  1030.     INLINE $2F3C, $0008, $002B, $7000, $A82A;
  1031.     {$ENDC}
  1032. FUNCTION NASetNoteChannelSoundLocalization(ci: NoteAllocator; noteChannel: NoteChannel; data: Handle): ComponentResult;
  1033.     {$IFC NOT GENERATINGCFM}
  1034.     INLINE $2F3C, $0008, $002C, $7000, $A82A;
  1035.     {$ENDC}
  1036.  
  1037. CONST
  1038.     kTuneQueueDepth                = 8;                            {  Deepest you can queue tune segments  }
  1039.  
  1040.  
  1041. TYPE
  1042.     TuneStatusPtr = ^TuneStatus;
  1043.     TuneStatus = RECORD
  1044.         tune:                    LongintPtr;                                {  currently playing tune  }
  1045.         tunePtr:                LongintPtr;                                {  position within currently playing piece  }
  1046.         time:                    TimeValue;                                {  current tune time  }
  1047.         queueCount:                INTEGER;                                {  how many pieces queued up?  }
  1048.         queueSpots:                INTEGER;                                {  How many more tunepieces can be queued  }
  1049.         queueTime:                TimeValue;                                {  How much time is queued up? (can be very inaccurate)  }
  1050.         reserved:                ARRAY [0..2] OF LONGINT;
  1051.     END;
  1052.  
  1053.     TuneCallBackProcPtr = ProcPtr;  { PROCEDURE TuneCallBack((CONST)VAR status: TuneStatus; refCon: LONGINT); }
  1054.  
  1055.     TunePlayCallBackProcPtr = ProcPtr;  { PROCEDURE TunePlayCallBack(VAR event: LONGINT; seed: LONGINT; refCon: LONGINT); }
  1056.  
  1057.     TuneCallBackUPP = UniversalProcPtr;
  1058.     TunePlayCallBackUPP = UniversalProcPtr;
  1059.     TunePlayer                            = ComponentInstance;
  1060.  
  1061. CONST
  1062.     kTunePlayerType                = 'tune';
  1063.  
  1064. FUNCTION TuneSetHeader(tp: TunePlayer; VAR header: LONGINT): ComponentResult;
  1065.     {$IFC NOT GENERATINGCFM}
  1066.     INLINE $2F3C, $0004, $0004, $7000, $A82A;
  1067.     {$ENDC}
  1068. FUNCTION TuneGetTimeBase(tp: TunePlayer; VAR tb: TimeBase): ComponentResult;
  1069.     {$IFC NOT GENERATINGCFM}
  1070.     INLINE $2F3C, $0004, $0005, $7000, $A82A;
  1071.     {$ENDC}
  1072. FUNCTION TuneSetTimeScale(tp: TunePlayer; scale: TimeScale): ComponentResult;
  1073.     {$IFC NOT GENERATINGCFM}
  1074.     INLINE $2F3C, $0004, $0006, $7000, $A82A;
  1075.     {$ENDC}
  1076. FUNCTION TuneGetTimeScale(tp: TunePlayer; VAR scale: TimeScale): ComponentResult;
  1077.     {$IFC NOT GENERATINGCFM}
  1078.     INLINE $2F3C, $0004, $0007, $7000, $A82A;
  1079.     {$ENDC}
  1080. FUNCTION TuneGetIndexedNoteChannel(tp: TunePlayer; i: LONGINT; VAR nc: NoteChannel): ComponentResult;
  1081.     {$IFC NOT GENERATINGCFM}
  1082.     INLINE $2F3C, $0008, $0008, $7000, $A82A;
  1083.     {$ENDC}
  1084. {  Values for when to start.  }
  1085.  
  1086. CONST
  1087.     kTuneStartNow                = 1;                            {  start after buffer is implied  }
  1088.     kTuneDontClipNotes            = 2;                            {  allow notes to finish their durations outside sample  }
  1089.     kTuneExcludeEdgeNotes        = 4;                            {  dont play notes that start at end of tune  }
  1090.     kTuneQuickStart                = 8;                            {  Leave all the controllers where they are, ignore start time  }
  1091.     kTuneLoopUntil                = 16;                            {  loop a queued tune if there's nothing else in the queue  }
  1092.     kTuneStartNewMaster            = 16384;
  1093.  
  1094. FUNCTION TuneQueue(tp: TunePlayer; VAR tune: LONGINT; tuneRate: Fixed; tuneStartPosition: LONGINT; tuneStopPosition: LONGINT; queueFlags: LONGINT; callBackProc: TuneCallBackUPP; refCon: LONGINT): ComponentResult;
  1095.     {$IFC NOT GENERATINGCFM}
  1096.     INLINE $2F3C, $001C, $000A, $7000, $A82A;
  1097.     {$ENDC}
  1098. FUNCTION TuneInstant(tp: TunePlayer; tune: UNIV Ptr; tunePosition: LONGINT): ComponentResult;
  1099.     {$IFC NOT GENERATINGCFM}
  1100.     INLINE $2F3C, $0008, $000B, $7000, $A82A;
  1101.     {$ENDC}
  1102. FUNCTION TuneGetStatus(tp: TunePlayer; VAR status: TuneStatus): ComponentResult;
  1103.     {$IFC NOT GENERATINGCFM}
  1104.     INLINE $2F3C, $0004, $000C, $7000, $A82A;
  1105.     {$ENDC}
  1106. {  Values for stopping.  }
  1107.  
  1108. CONST
  1109.     kTuneStopFade                = 1;                            {  do a quick, synchronous fadeout  }
  1110.     kTuneStopSustain            = 2;                            {  don't silece notes  }
  1111.     kTuneStopInstant            = 4;                            {  silence notes fast (else, decay them)  }
  1112.     kTuneStopReleaseChannels    = 8;                            {  afterwards, let the channels go  }
  1113.  
  1114. FUNCTION TuneStop(tp: TunePlayer; stopFlags: LONGINT): ComponentResult;
  1115.     {$IFC NOT GENERATINGCFM}
  1116.     INLINE $2F3C, $0004, $000D, $7000, $A82A;
  1117.     {$ENDC}
  1118. FUNCTION TuneSetVolume(tp: TunePlayer; volume: Fixed): ComponentResult;
  1119.     {$IFC NOT GENERATINGCFM}
  1120.     INLINE $2F3C, $0004, $0010, $7000, $A82A;
  1121.     {$ENDC}
  1122. FUNCTION TuneGetVolume(tp: TunePlayer): ComponentResult;
  1123.     {$IFC NOT GENERATINGCFM}
  1124.     INLINE $2F3C, $0000, $0011, $7000, $A82A;
  1125.     {$ENDC}
  1126. FUNCTION TunePreroll(tp: TunePlayer): ComponentResult;
  1127.     {$IFC NOT GENERATINGCFM}
  1128.     INLINE $2F3C, $0000, $0012, $7000, $A82A;
  1129.     {$ENDC}
  1130. FUNCTION TuneUnroll(tp: TunePlayer): ComponentResult;
  1131.     {$IFC NOT GENERATINGCFM}
  1132.     INLINE $2F3C, $0000, $0013, $7000, $A82A;
  1133.     {$ENDC}
  1134. FUNCTION TuneSetNoteChannels(tp: TunePlayer; count: LONGINT; VAR noteChannelList: NoteChannel; playCallBackProc: TunePlayCallBackUPP; refCon: LONGINT): ComponentResult;
  1135.     {$IFC NOT GENERATINGCFM}
  1136.     INLINE $2F3C, $0010, $0014, $7000, $A82A;
  1137.     {$ENDC}
  1138. FUNCTION TuneSetPartTranspose(tp: TunePlayer; part: LONGINT; transpose: LONGINT; velocityShift: LONGINT): ComponentResult;
  1139.     {$IFC NOT GENERATINGCFM}
  1140.     INLINE $2F3C, $000C, $0015, $7000, $A82A;
  1141.     {$ENDC}
  1142. FUNCTION TuneGetNoteAllocator(tp: TunePlayer): NoteAllocator;
  1143.     {$IFC NOT GENERATINGCFM}
  1144.     INLINE $2F3C, $0000, $0017, $7000, $A82A;
  1145.     {$ENDC}
  1146. FUNCTION TuneSetSofter(tp: TunePlayer; softer: LONGINT): ComponentResult;
  1147.     {$IFC NOT GENERATINGCFM}
  1148.     INLINE $2F3C, $0004, $0018, $7000, $A82A;
  1149.     {$ENDC}
  1150. FUNCTION TuneTask(tp: TunePlayer): ComponentResult;
  1151.     {$IFC NOT GENERATINGCFM}
  1152.     INLINE $2F3C, $0000, $0019, $7000, $A82A;
  1153.     {$ENDC}
  1154. FUNCTION TuneSetBalance(tp: TunePlayer; balance: LONGINT): ComponentResult;
  1155.     {$IFC NOT GENERATINGCFM}
  1156.     INLINE $2F3C, $0004, $001A, $7000, $A82A;
  1157.     {$ENDC}
  1158. FUNCTION TuneSetSoundLocalization(tp: TunePlayer; data: Handle): ComponentResult;
  1159.     {$IFC NOT GENERATINGCFM}
  1160.     INLINE $2F3C, $0004, $001B, $7000, $A82A;
  1161.     {$ENDC}
  1162. FUNCTION TuneSetHeaderWithSize(tp: TunePlayer; VAR header: LONGINT; size: LONGINT): ComponentResult;
  1163.     {$IFC NOT GENERATINGCFM}
  1164.     INLINE $2F3C, $0008, $001C, $7000, $A82A;
  1165.     {$ENDC}
  1166.  
  1167. TYPE
  1168.     MusicOpWord                            = LONGINT;
  1169.     MusicOpWordPtr                        = ^LONGINT;
  1170. {
  1171.      QuickTime Music Track Event Formats:
  1172.  
  1173.     At this time, QuickTime music tracks support 5 different event types -- REST events,
  1174.     short NOTE events, short CONTROL events, short GENERAL events, Long NOTE events, 
  1175.     long CONTROL events, and variable GENERAL events.
  1176.  
  1177.         • REST Event (4 bytes/event):
  1178.     
  1179.             (0 0 0) (5-bit UNUSED) (24-bit Rest Duration)
  1180.         
  1181.         • Short NOTE Events (4 bytes/event):
  1182.     
  1183.             (0 0 1) (5-bit Part) (6-bit Pitch) (7-bit Volume) (11-bit Duration)
  1184.         
  1185.             where:    Pitch is offset by 32 (Actual pitch = pitch field + 32)
  1186.  
  1187.         • Short CONTROL Events (4 bytes/event):
  1188.     
  1189.             (0 1 0) (5-bit Part) (8-bit Controller) (1-bit UNUSED) (1-bit Sign) (7-bit MSB) (7-bit LSB)
  1190.                                                                          ( or 15-bit Signed Value)
  1191.         • Short GENERAL Event (4 bytes/event):
  1192.     
  1193.             (0 1 1) (1-bit UNUSED) (12-bit Sub-Type) (16-bit Value)
  1194.     
  1195.         • Long NOTE Events (8 bytes/event):
  1196.     
  1197.             (1 0 0 1) (12-bit Part) (1-bit UNUSED) (7-bit Pitch) (1-bit UNUSED) (7-bit Volume)
  1198.             (1 0) (8-bit UNUSED) (22-bit Duration)
  1199.         
  1200.         • Long CONTROL Event (8 bytes/event):
  1201.         
  1202.             (1 0 1 0) (12-bit Part) (16-bit Value MSB) 
  1203.             (1 0) (14-bit Controller) (16-bit Value LSB)
  1204.     
  1205.         • Long KNOB Event (8 bytes/event):
  1206.     
  1207.             (1 0 1 1) (12-bit Sub-Type) (16-bit Value MSB)
  1208.             (1 0) (14-bit KNOB) (16-bit Value LSB)
  1209.     
  1210.         • Variable GENERAL Length Events (N bytes/event):
  1211.     
  1212.             (1 1 1 1) (12-bit Sub-Type) (16-bit Length)
  1213.                 :
  1214.             (32-bit Data values)
  1215.                 :
  1216.             (1 1) (14-bit UNUSED) (16-bit Length)
  1217.     
  1218.             where:    Length field is the number of LONG words in the record.
  1219.                     Lengths include the first and last long words (Minimum length = 2)
  1220.                 
  1221.     The following event type values have not been used yet and are reserved for 
  1222.     future expansion:
  1223.         
  1224.         • (1 0 0 0)        (8 bytes/event)
  1225.         • (1 1 0 0)        (N bytes/event)
  1226.         • (1 1 0 1)        (N bytes/event)
  1227.         • (1 1 1 0)        (N bytes/event)
  1228.         
  1229.     For all events, the following generalizations apply:
  1230.     
  1231.         -    All duration values are specified in Millisecond units.
  1232.         -     Pitch values are intended to map directly to the MIDI key numbers.
  1233.         -    Controllers from 0 to 127 correspond to the standard MIDI controllers.
  1234.             Controllers greater than 127 correspond to other controls (i.e., Pitch Bend, 
  1235.             Key Pressure, and Channel Pressure).    
  1236. }
  1237. {  Defines for the implemented music event data fields }
  1238.  
  1239. CONST
  1240.     kRestEventType                = $00000000;                    {  lower 3-bits  }
  1241.     kNoteEventType                = $00000001;                    {  lower 3-bits  }
  1242.     kControlEventType            = $00000002;                    {  lower 3-bits  }
  1243.     kMarkerEventType            = $00000003;                    {  lower 3-bits  }
  1244.     kUndefined1EventType        = $00000008;                    {  4-bits  }
  1245.     kXNoteEventType                = $00000009;                    {  4-bits  }
  1246.     kXControlEventType            = $0000000A;                    {  4-bits  }
  1247.     kKnobEventType                = $0000000B;                    {  4-bits  }
  1248.     kUndefined2EventType        = $0000000C;                    {  4-bits  }
  1249.     kUndefined3EventType        = $0000000D;                    {  4-bits  }
  1250.     kUndefined4EventType        = $0000000E;                    {  4-bits  }
  1251.     kGeneralEventType            = $0000000F;                    {  4-bits  }
  1252.     kXEventLengthBits            = $00000002;                    {  2 bits: indicates 8-byte event record  }
  1253.     kGeneralEventLengthBits        = $00000003;                    {  2 bits: indicates variable length event record  }
  1254.     kEventLen                    = 1;                            {  length of events in long words  }
  1255.     kXEventLen                    = 2;
  1256.     kRestEventLen                = 1;                            {  length of events in long words  }
  1257.     kNoteEventLen                = 1;
  1258.     kControlEventLen            = 1;
  1259.     kMarkerEventLen                = 1;
  1260.     kXNoteEventLen                = 2;
  1261.     kXControlEventLen            = 2;
  1262.     kGeneralEventLen            = 2;                            {  2 or more, however  }
  1263.                                                                 {  Universal Event Defines }
  1264.     kEventLengthFieldPos        = 30;                            {  by looking at these two bits of the 1st or last word               }
  1265.     kEventLengthFieldWidth        = 2;                            {  of an event you can determine the event length                       }
  1266.                                                                 {  length field: 0 & 1 => 1 long; 2 => 2 longs; 3 => variable length  }
  1267.     kEventTypeFieldPos            = 29;                            {  event type field for short events  }
  1268.     kEventTypeFieldWidth        = 3;                            {  short type is 3 bits  }
  1269.     kXEventTypeFieldPos            = 28;                            {  event type field for extended events  }
  1270.     kXEventTypeFieldWidth        = 4;                            {  extended type is 4 bits  }
  1271.     kEventPartFieldPos            = 24;
  1272.     kEventPartFieldWidth        = 5;
  1273.     kXEventPartFieldPos            = 16;                            {  in the 1st long word  }
  1274.     kXEventPartFieldWidth        = 12;                            {  Rest Events }
  1275.     kRestEventDurationFieldPos    = 0;
  1276.     kRestEventDurationFieldWidth = 24;
  1277.     kRestEventDurationMax        = $00FFFFFF;                    {  Note Events }
  1278.     kNoteEventPitchFieldPos        = 18;
  1279.     kNoteEventPitchFieldWidth    = 6;
  1280.     kNoteEventPitchOffset        = 32;                            {  add to value in pitch field to get actual pitch  }
  1281.     kNoteEventVolumeFieldPos    = 11;
  1282.     kNoteEventVolumeFieldWidth    = 7;
  1283.     kNoteEventVolumeOffset        = 0;                            {  add to value in volume field to get actual volume  }
  1284.     kNoteEventDurationFieldPos    = 0;
  1285.     kNoteEventDurationFieldWidth = 11;
  1286.     kNoteEventDurationMax        = $000007FF;
  1287.     kXNoteEventPitchFieldPos    = 0;                            {  in the 1st long word  }
  1288.     kXNoteEventPitchFieldWidth    = 16;
  1289.     kXNoteEventDurationFieldPos    = 0;                            {  in the 2nd long word  }
  1290.     kXNoteEventDurationFieldWidth = 22;
  1291.     kXNoteEventDurationMax        = $003FFFFF;
  1292.     kXNoteEventVolumeFieldPos    = 22;                            {  in the 2nd long word  }
  1293.     kXNoteEventVolumeFieldWidth    = 7;                            {  Control Events }
  1294.     kControlEventControllerFieldPos = 16;
  1295.     kControlEventControllerFieldWidth = 8;
  1296.     kControlEventValueFieldPos    = 0;
  1297.     kControlEventValueFieldWidth = 16;
  1298.     kXControlEventControllerFieldPos = 0;                        {  in the 2nd long word  }
  1299.     kXControlEventControllerFieldWidth = 16;
  1300.     kXControlEventValueFieldPos    = 0;                            {  in the 1st long word  }
  1301.     kXControlEventValueFieldWidth = 16;                            {  Knob Events }
  1302.     kKnobEventValueHighFieldPos    = 0;                            {  1st long word  }
  1303.     kKnobEventValueHighFieldWidth = 16;
  1304.     kKnobEventKnobFieldPos        = 16;                            {  2nd long word  }
  1305.     kKnobEventKnobFieldWidth    = 14;
  1306.     kKnobEventValueLowFieldPos    = 0;                            {  2nd long word  }
  1307.     kKnobEventValueLowFieldWidth = 16;                            {  Marker Events }
  1308.     kMarkerEventSubtypeFieldPos    = 16;
  1309.     kMarkerEventSubtypeFieldWidth = 8;
  1310.     kMarkerEventValueFieldPos    = 0;
  1311.     kMarkerEventValueFieldWidth    = 16;                            {  General Events }
  1312.     kGeneralEventSubtypeFieldPos = 16;                            {  in the last long word  }
  1313.     kGeneralEventSubtypeFieldWidth = 14;
  1314.     kGeneralEventLengthFieldPos    = 0;                            {  in the 1st & last long words  }
  1315.     kGeneralEventLengthFieldWidth = 16;
  1316.  
  1317. {  General Event Defined Types }
  1318.     kGeneralEventNoteRequest    = 1;                            {  Encapsulates NoteRequest data structure  }
  1319.     kGeneralEventPartKey        = 4;
  1320.     kGeneralEventTuneDifference    = 5;                            {  Contains a standard sequence, with end marker, for the tune difference of a sequence piece (halts QuickTime 2.0 Music)  }
  1321.     kGeneralEventAtomicInstrument = 6;                            {  Encapsulates AtomicInstrument record  }
  1322.     kGeneralEventKnob            = 7;                            {  knobID/knobValue pairs; smallest event is 4 longs  }
  1323.     kGeneralEventMIDIChannel    = 8;                            {  used in tune header, one longword identifies the midi channel it originally came from  }
  1324.     kGeneralEventPartChange        = 9;                            {  used in tune sequence, one longword identifies the tune part which can now take over this part's note channel (similar to program change) (halts QuickTime 2.0 Music) }
  1325.     kGeneralEventNoOp            = 10;                            {  guaranteed to do nothing and be ignored. (halts QuickTime 2.0 Music)  }
  1326.     kGeneralEventUsedNotes        = 11;                            {  four longwords specifying which midi notes are actually used, 0..127 msb to lsb  }
  1327.  
  1328. {  Marker Event Defined Types        // marker is 60 ee vv vv in hex, where e = event type, and v = value }
  1329.     kMarkerEventEnd                = 0;                            {  marker type 0 means: value 0 - stop, value != 0 - ignore }
  1330.     kMarkerEventBeat            = 1;                            {  value 0 = single beat; anything else is 65536ths-of-a-beat (quarter note) }
  1331.     kMarkerEventTempo            = 2;                            {  value same as beat marker, but indicates that a tempo event should be computed (based on where the next beat or tempo marker is) and emitted upon export }
  1332.  
  1333. {  UPP call backs  }
  1334.     uppMusicMIDISendProcInfo = $00000FF0;
  1335.     uppMusicMIDIReadHookProcInfo = $000003F0;
  1336.     uppMusicOfflineDataProcInfo = $00000FF0;
  1337.     uppTuneCallBackProcInfo = $000003C0;
  1338.     uppTunePlayCallBackProcInfo = $00000FC0;
  1339.  
  1340. FUNCTION NewMusicMIDISendProc(userRoutine: MusicMIDISendProcPtr): MusicMIDISendUPP;
  1341.     {$IFC NOT GENERATINGCFM }
  1342.     INLINE $2E9F;
  1343.     {$ENDC}
  1344.  
  1345. FUNCTION NewMusicMIDIReadHookProc(userRoutine: MusicMIDIReadHookProcPtr): MusicMIDIReadHookUPP;
  1346.     {$IFC NOT GENERATINGCFM }
  1347.     INLINE $2E9F;
  1348.     {$ENDC}
  1349.  
  1350. FUNCTION NewMusicOfflineDataProc(userRoutine: MusicOfflineDataProcPtr): MusicOfflineDataUPP;
  1351.     {$IFC NOT GENERATINGCFM }
  1352.     INLINE $2E9F;
  1353.     {$ENDC}
  1354.  
  1355. FUNCTION NewTuneCallBackProc(userRoutine: TuneCallBackProcPtr): TuneCallBackUPP;
  1356.     {$IFC NOT GENERATINGCFM }
  1357.     INLINE $2E9F;
  1358.     {$ENDC}
  1359.  
  1360. FUNCTION NewTunePlayCallBackProc(userRoutine: TunePlayCallBackProcPtr): TunePlayCallBackUPP;
  1361.     {$IFC NOT GENERATINGCFM }
  1362.     INLINE $2E9F;
  1363.     {$ENDC}
  1364.  
  1365. FUNCTION CallMusicMIDISendProc(self: MusicComponent; refCon: LONGINT; VAR mmp: MusicMIDIPacket; userRoutine: MusicMIDISendUPP): ComponentResult;
  1366.     {$IFC NOT GENERATINGCFM}
  1367.     INLINE $205F, $4E90;
  1368.     {$ENDC}
  1369.  
  1370. FUNCTION CallMusicMIDIReadHookProc(VAR mp: MusicMIDIPacket; myRefCon: LONGINT; userRoutine: MusicMIDIReadHookUPP): ComponentResult;
  1371.     {$IFC NOT GENERATINGCFM}
  1372.     INLINE $205F, $4E90;
  1373.     {$ENDC}
  1374.  
  1375. FUNCTION CallMusicOfflineDataProc(SoundData: Ptr; numBytes: LONGINT; myRefCon: LONGINT; userRoutine: MusicOfflineDataUPP): ComponentResult;
  1376.     {$IFC NOT GENERATINGCFM}
  1377.     INLINE $205F, $4E90;
  1378.     {$ENDC}
  1379.  
  1380. PROCEDURE CallTuneCallBackProc({CONST}VAR status: TuneStatus; refCon: LONGINT; userRoutine: TuneCallBackUPP);
  1381.     {$IFC NOT GENERATINGCFM}
  1382.     INLINE $205F, $4E90;
  1383.     {$ENDC}
  1384.  
  1385. PROCEDURE CallTunePlayCallBackProc(VAR event: LONGINT; seed: LONGINT; refCon: LONGINT; userRoutine: TunePlayCallBackUPP);
  1386.     {$IFC NOT GENERATINGCFM}
  1387.     INLINE $205F, $4E90;
  1388.     {$ENDC}
  1389.  
  1390. {$ALIGN RESET}
  1391. {$POP}
  1392.  
  1393. {$SETC UsingIncludes := QuickTimeMusicIncludes}
  1394.  
  1395. {$ENDC} {__QUICKTIMEMUSIC__}
  1396.  
  1397. {$IFC NOT UsingIncludes}
  1398.  END.
  1399. {$ENDC}
  1400.